package btree;

import java.util.ArrayList;

import settings.Global;

import data.DiskPage;

public class BNode {
	public DiskPage page1;
	public DiskPage page2;
	public BNode child1;
	public BNode child2;
	public BNode child3;
	public int numPages;

	//pointers
	public BNode parent;

	//Constructor
	public BNode(){
		parent = null;
		page1=null;
		page2=null;
		child1=null;
		child2=null;
		child3=null;
		numPages=0;
	}

	//add the key //true = success //false = full
	public boolean addDiskPage(DiskPage dp){
		if(numPages==0){
			page1=dp;
			numPages++;
			return true;
		}
		else if(numPages==1){
			page2=dp;
			numPages++;
			return true;
		}
		else{
			return false;//false
		}
	}
	
	//remove a key
	public DiskPage remove(){
		DiskPage temp = page2; 
		numPages--;
		return temp;
	}
}
